<template>
  <div class="header-container">
    <!-- 顶部标题 -->
    <div class="title-container">
      <div class="title-container-back-btn" @click="HeaderHooks.handlePageBack">
        <i class="iconfont icon-fanhui"></i>
        <span>返回</span>
      </div>
      <div class="title-container-content">
        <!-- 通过数据拼接顶部标题 -->
        [{{ route.query.id }}-{{ interfaceData.pageSettingList.taskName }}]
        {{ interfaceData.resultDataList.seriesUid }}
      </div>
    </div>
    <!-- 工具栏 -->
    <div class="tool-bar-container">
      <div class="tool-bar-left">
        <!-- 查看工具 -->
        <query-tool v-bind="reactive({ ...$attrs, ...props, queryBarList })"></query-tool>
        <mark-tool
          v-bind="reactive({ ...$attrs, ...props, markBarList, videoDisabled })"
        ></mark-tool>
      </div>
      <div class="tool-bar-right">
        <tool-bar-right v-bind="reactive({ ...$attrs, ...props })"></tool-bar-right>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup name="PageHeader">
import { reactive, type Component } from 'vue';
import { useRoute } from "vue-router";
import * as Store from "@/store";
import QueryTool from './components/QueryTool.vue';
import MarkTool from './components/MarkTool.vue';
import ToolBarRight from "./components/ToolBarRight.vue";
// import useHeader from '@/views/filmRead/hooks/useHeader';

interface Prop {
  type: string;
  isEye: boolean;
  isColor: boolean;
  isDel: boolean;
  isTips: boolean;
  disabled: boolean;
  pageType: string;
  queryBarList: Header.QueryDataList[];
  markBarList: Header.MarkDataList[];
  HeaderHooks: Header.HeaderHooks;
  isComponent: Component;
  videoDisabled: boolean;
}

const props = defineProps<Prop>();
const FilmRead = Store.useFilmRead();
// const HeaderHooks = useHeader(props.type);
const { interfaceData } = FilmRead;
const route = useRoute();
</script>

<style lang="less" scoped>
.title-container {
  width: 100%;
  background-color: #192c39;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  &-back-btn {
    color: #ccc;
    user-select: none;
    i {
      margin-left: 18px;
      margin-right: 8px;
    }
    span {
      font-weight: 400;
      font-size: 16px;
    }
  }
  &-back-btn:hover {
    cursor: pointer;
  }
  &-content {
    padding: 11px 0;
    font-weight: 400;
    font-size: 14px;
    color: #ccc;
    flex: 1;
    text-align: center;
    margin-top: 1.91px;
  }
}

.tool-bar-container {
  width: 100%;
  height: 54px;
  // padding: 4px 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #111e26;
  border-top: 1px solid #111e26;
  border-bottom: 1px solid #111e26;
  .tool-bar-left {
    display: flex;
    align-items: center;
  }
  .tool-bar-right {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
</style>
